package com.info33.platform.doc.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.info33.platform.common.mvc.controller.BaseController;
import com.info33.platform.common.mvc.vo.Result;
import com.info33.platform.doc.entity.DocFile;
import com.info33.platform.doc.service.DocFileService;
import com.info33.platform.doc.vo.DocFileStatisticsVO;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * @author admin
 */
@RestController
@RequestMapping("/DocFileStatistics")
@Api(tags = "文档管理 -- 文档信息统计")
public class DocFileStatisticsController extends BaseController<DocFileService, DocFile> {

    private final DocFileService docFileService;

    @Autowired
    public DocFileStatisticsController(DocFileService docFileService) {
        super(docFileService);
        this.docFileService = docFileService;
    }

    @GetMapping(value = "/fileStatistics")
    @ApiOperation(value = "文档统计")
    public Result<List<DocFileStatisticsVO>> fileStatistics() {
        return Result.ok(docFileService.fileStatistics(getCurrentUser()));
    }

}